package cn.agiledata.bank.information.dao;

import java.util.HashMap;
import java.util.Map;

import org.hibernate.SessionFactory;

import cn.agiledata.bank.common.dao.HqlPageListTemplate;
import com.vnv.infrastructure.logic.IPBAppFactory;
import cn.agiledata.bank.information.form.InformationBean;

public class InfoList extends HqlPageListTemplate{
	private InformationBean informationBean;
	
	public InfoList(InformationBean informationBean) {

			this.setSessionFactory((SessionFactory) IPBAppFactory.getObj("sessionFactory"));
	
		this.informationBean = informationBean;
	}
	public String getHql() {
		String hql = "from Information i where i.kind = :kind and i.status = 'Y' and :now >= i.publishStartdate  and :now <= i.publishEnddate order by i.occurDate desc ,i.publishStartdate desc ";
		return hql;
	}

	public String getPageRecord() {
		return "25";
	}

	public Map getParams() {
		Map map = new HashMap();
		map.put("kind", informationBean.getKind());
		map.put("now", informationBean.getNow());
		return map;
	}

	public String getStartPage() {
		return informationBean.getStartPage();
	}
    
}
